home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #44 (May 89) / Hyper Stuff.sit / SimpleXCMD.C < prev    next >
Text File  |  1989-03-01  |  2KB  |  58 lines

  1. /********************************/
  2. /* File: SimpleXCMD.c            */
  3. /*                                */
  4. /* This is what a simple XCMD     */
  5. /* written in Lightspeed "C"    */
  6. /* In order to build this code    */
  7. /* resource, you will need the    */
  8. /* two files "HyperXCMD.h" and    */
  9. /* XCMDGlue.c.                  */
  10. /*                                */
  11. /* ----------------------------    */
  12. /* To Build:                    */
  13. /*                                 */
  14. /* (1) Create a project using    */
  15. /* this file as well as the     */
  16. /* XCMD.Glue.c file. (Set         */
  17. /* project type to     XCMD (or    */
  18. /* XFCN) from the Project menu.    */
  19. /*                                */
  20. /* (2) Bring the project up to    */
  21. /* date.                        */
  22. /*                                */
  23. /* (3) Build Code Resource.     */
  24. /*                                */
  25. /* (4) Use ResEdit to copy the     */
  26. /* resource to your stack.        */
  27. /********************************/
  28.  
  29. #include    <MacTypes.h>
  30. #include    <OSUtil.h>
  31. #include    <MemoryMgr.h>
  32. #include    <FileMgr.h>
  33. #include    <ResourceMgr.h>
  34. #include     "HyperXCmd.h"
  35.  
  36. pascal void main( paramPtr )
  37.     XCmdBlockPtr    paramPtr;
  38. {
  39.     char    theString[256];        /* A "Pascal" String     */    
  40.  
  41.     theString[0] = '\0x0B';        /* Remember, static        */
  42.     theString[1] = 'H';            /* strings are placed    */
  43.     theString[2] = 'E';            /* in the global pool    */
  44.     theString[3] = 'L';            /* CODE resources such     */
  45.     theString[4] = 'L';            /* as XCMDS and XFCNS    */
  46.     theString[5] = 'O';            /* don't have access to */
  47.     theString[6] = ' ';            /* globals so you have    */
  48.     theString[7] = 'W';            /* to discretely set the*/
  49.     theString[8] = 'O';            /* string's value        */
  50.     theString[9] = 'R';
  51.     theString[10]= 'L';
  52.     theString[11]= 'D';
  53.  
  54.     /* A sample callback example    */
  55.     paramPtr->returnValue = PasToZero( paramPtr, &theString );
  56. }
  57.  
  58.